//
//  UIAlertController+QTZ.m
//  QTZ
//
//  Created by ski on 2017/8/18.
//  Copyright © 2017年 ski. All rights reserved.
//

#import "UIAlertController+QTZ.h"

@implementation UIAlertController (QTZ)
@dynamic ski_titleLabel;
@dynamic ski_messageLabel;

- (NSArray *)ski_viewArray:(UIView *)root {
    static NSArray *_subviews = nil;
    _subviews = nil;
    for (UIView *v in root.subviews) {
        if (_subviews) {
            break;
        }
        if ([v isKindOfClass:[UILabel class]]) {
            _subviews = root.subviews;
            return _subviews;
        }
        [self ski_viewArray:v];
    }
    return _subviews;
}

- (UILabel *)ski_titleLabel
{
    return [[self ski_viewArray:self.view] safeObjectAtIndex:0];
}

- (UILabel *)ski_messageLabel
{
    return [[self ski_viewArray:self.view] safeObjectAtIndex:1];
}

@end
